#ifndef TABPANELCONTAINERFACTORY_H
#define TABPANELCONTAINERFACTORY_H

#include <pluginui/manager/AbstractPanelContainerFactory.h>

namespace antu
{
namespace plugin
{
namespace ui
{
class TabPanelContainer : public AbstractPanelContainer
{
    Q_OBJECT

public:
    TabPanelContainer(const QString& name, const QString& title,
                      Qt::DockWidgetArea area = Qt::NoDockWidgetArea,
                      Qt::DockWidgetAreas allowedAreas = Qt::LeftDockWidgetArea |
                                                         Qt::RightDockWidgetArea |
                                                         Qt::BottomDockWidgetArea,
                      QDockWidget::DockWidgetFeatures features = QDockWidget::DockWidgetClosable |
                                                                 QDockWidget::DockWidgetFloatable |
                                                                 QDockWidget::DockWidgetMovable);

    virtual void addSeparator(QFrame::Shadow shadow = QFrame::Sunken);

    virtual QWidget* containerWidget();

private slots:
    void currentTabChanged(int index);

protected:
    virtual void addToContainer(PanelItem* pPanelItem, int stretch = 0);

    virtual void doFinalize();

    QWidget* m_pWidget;

    // AbstractPanelContainer interface
public:
    virtual void setChangeWindowTitleWithTab(bool changeWithTab);
};

class TabPanelContainerFactory : public AbstractPanelContainerFactory
{
public:
    TabPanelContainerFactory();

    virtual AbstractPanelContainer* createContainer(const QString& name,
                                                    const QString& title,
                                                    Qt::DockWidgetArea area = Qt::NoDockWidgetArea,
                                                    Qt::DockWidgetAreas allowedAreas = Qt::LeftDockWidgetArea |
                                                                                       Qt::RightDockWidgetArea |
                                                                                       Qt::BottomDockWidgetArea,
                                                    QDockWidget::DockWidgetFeatures features = QDockWidget::DockWidgetClosable |
                                                                                               QDockWidget::DockWidgetFloatable |
                                                                                               QDockWidget::DockWidgetMovable);
};
}
}
}

#endif // TABPANELCONTAINERFACTORY_H
